# # import os

# # def list_files(path, entry_path):
# #     result = []  # 创建一个空列表用于存储输出结果
    
# #     # 获取当前路径下的所有文件和文件夹
# #     content = os.listdir(path)

# #     for item in content:
# #         item_path = os.path.join(path, item)
        
# #         # 如果是文件夹，则递归调用函数
# #         if os.path.isdir(item_path):
# #             # print(os.path.relpath(item_path, entry_path))
# #             list_files(item_path, entry_path)  # 递归调用并将结果扩展到列表中
# #         # 如果是文件，则输出文件名（不含路径和后缀）并存储到结果列表中（包含完整路径）
# #         else:
# #             file_name, file_extension = os.path.splitext(os.path.relpath(item_path, entry_path))
# #             # print(file_name)
# #             result.append(file_name)

# #     return result  # 返回结果列表

# # # 指定要访问的入口目录路径
# # entry_folder = "/home/terrry/CodeGraphQL/src/code2Graph/example"

# # # 调用函数开始递归遍历文件夹，并存储结果到数组中
# # # files = list_files(entry_folder, entry_folder)

# # # 打印输出结果
# # # for file in files:
# # #     print(file)

# # dir = "/home/terrry/CodeGraphQL/src/code2Graph/example"

# # def get_test_scripts(dir):
# #     test_scripts = []
# #     for root, dirs, files in os.walk(dir):
# #         for file in files:
# #             file_path = os.path.relpath(os.path.join(root, file), start=dir)
# #             file_path = file_path.replace('\\', '/')  # 将 \ 替换为 /
# #             test_scripts.append(dir + "/" + file_path)
# #     return test_scripts

# # print(get_test_scripts(dir))


# # # # create graph first
# # # g = (
# # #     Graph()
# # #     .traversal()
# # #     .withRemote(DriverRemoteConnection(connection_string(), "g"))
# # # )
# # # g.V().drop().iterate()
# # # build folder relationship
# # # g.addV("folder").property("folderName", os.path.basename(dir)).next()
# # # list_files(dir, dir, g)
# # # start build cfg
# # # test_scripts = get_test_scripts(dir)
# # # print(dir)
# # # for script_path in test_scripts:
# # #     test_script = os.path.basename(script_path)
# # #     # print(test_script)
# # #     file_name, file_extension = os.path.splitext(os.path.relpath(script_path, dir))
# # #     print(file_name)
# #     # cfg_builder = CFGBuilder()
# #     # flattened_cfg = cfg_builder.build_from_file(
# #     #     test_script, script_path, flattened=True
# #     # )
# #     # all_block = get_all_block_of_cfgs(flattened_cfg)
# #     # all_block_dict = get_all_block_of_cfgs_dict(all_block)
# #     # build_and_input_cfgs(flattened_cfg, g)

# import sample

# test_test = sample.A()

# test_test.t1()

# test_test.t2(sample.total)